package cn.auto.controller;

import java.util.HashMap;

import com.jfinal.core.ActionKey;

import cn.auto.service.SuiteCaseService;
import cn.auto.utility.HelperController;
import cn.auto.utility.Status;
import net.sf.json.JSONObject;

public class SuiteCaseController extends HelperController {
	
	SuiteCaseService service=new SuiteCaseService();
	
	public void index() {
		HashMap<Object, Object> result=service.getSC();
		String st = (String) result.get("status"); 
		HashMap<String, String> msg=new HashMap<>();
		msg.put(Status.SUCCESS, "获取成功!");
		msg.put(Status.NORECORD, "无记录!");
		msg.put(Status.FAILED, "获取失败!");
		responseResult(st, msg, result.get("body"));
	}
	
	@ActionKey("/sc/edit")
	public void editsc() {
		JSONObject jo = readRequstJson();
		String st=service.editSC(jo);
		String[] msg = { "编辑测试集用例成功!", "编辑测试集用例失败!" };
		responseResult(st, msg);
	}
	
}
